/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package RMI;


import java.net.InetAddress;
import java.net.UnknownHostException;
import java.rmi.RemoteException;
import java.rmi.server.UnicastRemoteObject;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JOptionPane;

/**
 *
 * @author TNT
 */
public class Connect_implements extends UnicastRemoteObject implements Connect_interface{
    S_Server server;
    public String chuoi[];
    public Connect_implements(S_Server server)throws RemoteException{
        this.server= server;
    }
    
   

    @Override
    public String[] getProduct() throws RemoteException {
        Product a = new Product(chuoi);
        String SP[] = a.getAll();
        return SP;
    }

    @Override
    public void addHelp(String email, String name, String question) throws RemoteException {
        Help h = new Help(chuoi);
        h.addHelp(email, name, question);
    }

    @Override
    public String[] getProductDetail(String ID) throws RemoteException {
        Product a = new Product(chuoi);
        String Prd[] = a.getProductDetail(ID);
        return Prd;
    }

    @Override
    public String checkAdmin(String id, String password) throws RemoteException {
        Admin a = new Admin(chuoi);
        String Admin = a.checkAdmin(id, password);
        return Admin;
    }

    @Override
    public String[] searchProduct(String name, String provider, String cost) throws RemoteException {
       Search a = new Search(chuoi);
       String Prd[] = a.searchProduct(name, provider, cost);
       return Prd;
    }

    @Override
    public String[] searchProduct(String keyword) throws RemoteException {
        Search a = new Search(chuoi);
        String Prd[] = a.searchProduct(keyword);
        return Prd;
    }

    @Override
    public String[] getAllProduct() throws RemoteException {
        Product a = new Product(chuoi);
        String SP[] = a.getProduct();
        return SP;
    }

    @Override
    public void editProduct(String id, String name, String provider, String cost, String detail, String state) throws RemoteException {
        Product a = new Product(chuoi);
        
        
    }
}
